package com.jubaopen.dao.ibatis;

import java.util.List;
import java.util.Map;

import com.jubaopen.bean.BankHistory;
import com.jubaopen.dao.BankHistoryDAO;

public class BankHistoryDAOImpl extends BaseIBatisDao implements BankHistoryDAO {

	@Override
	public int add(BankHistory bankHistory) {
		return (Integer) this.getSqlMapClientTemplate().insert("BankHistoryMapper.insert", bankHistory);
	}

	@Override
	public BankHistory getAccount(Map<String, Object> entry) {
		return (BankHistory) this.getSqlMapClientTemplate().queryForObject("BankHistoryMapper.getAccount", entry);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<BankHistory> getList(int userId) {
		return (List<BankHistory>) this.getSqlMapClientTemplate().queryForList("BankHistoryMapper.getList", userId);
	}

	@Override
	public int update(BankHistory history) {
		return this.getSqlMapClientTemplate().update("BankHistoryMapper.update", history);
	}

	@Override
	public int delete(Map<String, Object> entry) {
		return this.getSqlMapClientTemplate().delete("BankHistoryMapper.delete", entry);
	}
}
